package com.karrim.client.mvp.presenter;

import com.google.gwt.event.shared.GwtEvent.Type;
import com.google.inject.Inject;
import com.google.web.bindery.event.shared.EventBus;
import com.gwtplatform.mvp.client.Presenter;
import com.gwtplatform.mvp.client.PresenterWidget;
import com.gwtplatform.mvp.client.View;
import com.gwtplatform.mvp.client.annotations.ContentSlot;
import com.gwtplatform.mvp.client.annotations.NameToken;
import com.gwtplatform.mvp.client.annotations.ProxyStandard;
import com.gwtplatform.mvp.client.proxy.ProxyPlace;
import com.gwtplatform.mvp.client.proxy.RevealContentHandler;
import com.gwtplatform.mvp.client.proxy.RevealRootContentEvent;
import com.karrim.client.mvp.NameTokens;

/**
 *
 * @author andrea.cantafio
 */
public class MainPresenter extends Presenter<MainPresenter.NView, MainPresenter.NProxy> {

    public interface NView extends View {
    }

    @ProxyStandard
    @NameToken(NameTokens.home)  // Do not use {';', '=', '/'} !
    public interface NProxy extends ProxyPlace<MainPresenter> {
    }

    @Inject
    public MainPresenter(EventBus eventBus, NView view, NProxy proxy) {
        super(eventBus, view, proxy);
    }

    @Override
    protected void revealInParent() {
        RevealRootContentEvent.fire(this, this);
    }
    
    @ContentSlot
    public static final Type<RevealContentHandler<?>> TYPE_SET_MAIN_CONTENT = new Type<RevealContentHandler<?>> ();
}
